/**
 * Created by Administrator on 2018/8/28.
 */
$CertusJsonAjax.ajax("queryCCBXLCProcessTrace",{
    "processInstanceId": $CertusJsonAjax.getProInstanceId(),
    "stepInstanceId": $CertusJsonAjax.getStepInstanceId()
},function(res){
    ;
    $$scope.traceRecord = res.data;
})
var afrColumnsHead = [{
    id: 'travelCode',
    title: '报销单号',
    width: 150,
    type: 'string',
    columnClass: 'text-center',
}, {
    id: 'afrType',
    title: '报销类别',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        return "出差报销";
    }
}, {
    id: 'tmpInvoiceNumber',
    title: '发票总数目',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
}, {
    id: 'totalAmount',
    title: '报销总金额',
    type: 'string',
    width: 150,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '￥' + value + '元';
        return content;
      }
}, {
    id: 'temMsg',
    title: '申请说明',
    type: 'string',
    columnClass: 'text-left',
}, {
    id: 'applyManName',
    title: '申请人',
    type: 'string',
    width: 80,
    columnClass: 'text-center',
},{
    id: 'afrTime',
    title: '申请时间',
    type: 'string',
    width: 100,
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var date = new Date(record.createTime);
        var content = $.fn.dlshouwen.grid.tools.dateFormat(date, "yyyy-MM-dd hh:mm");
        return content;
    }
},{
    id: 'operation',
    title: '操作',
    width: 100,
    type: 'string',
    columnClass: 'text-center',
    resolution: function (value, record, column, grid, dataNo, columnNo) {
        var content = '';
        content += '<button class="btn btn-xs btn-success" onclick="toDoCCBX(\'' + record.trCode + '\');"><i class="fa fa-edit"></i>  查看办理</button>';
        return content;
    }
}];
// var afrGrid = $.fn.dlshouwen.grid.init(afrOption);
//angular 初始化 方法
function bxpage($scope, $route, CertusFormAjax, CertusJsonAjax, $location, $http, $cookies,$routeParams){
    $scope.openCCsqView = function(){
        window.location.href="#/addCCbxLc"
    }

    //展示datagrid 内容
    var dataInit = CertusJsonAjax.dataInit("listccbxDatagrid",null,afrColumnsHead,'afrContainer','afrToolBarContainer');
}

//跳转 查看页面
function toDoCCBX(trCode){

    window.location.href = "#/ccbxInfoDetail/"+trCode;
}